home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / pcw.zip / WNDDEMO.C < prev    next >
Text File  |  1990-01-30  |  870b  |  36 lines

  1. #include <stdio.h>
  2. #include <time.h>
  3. #include "pcwproto.h"
  4.  
  5. #define  rnd(x) (rand() % (x))
  6. void main(void) {
  7.  
  8.    WNDPTR *wnd;
  9.    time_t timer;
  10.    int tl, bl, wr, wc, lcv, ch;
  11.    int mxr, mxc;
  12.    static char *msg[] = {
  13.       "Welcome to C",
  14.       "The Powerful Language",
  15.       "for",
  16.       "Major Applications Software",
  17.       NULL
  18.    };
  19.  
  20. /* Create a box with a advertisment for the C language */
  21.  
  22.    get_cursor_size(&tl,&bl); set_cursor_size(0,0);
  23.    chk_video_state(&mxr,&mxc);
  24.    bordercolor(YELLOW,BLUE);
  25.    wnd = wframe(7,19,15,60,LIGHTGRAY,BLUE);
  26.    q_block_write(9,CENTER,LIGHTGRAY,BLUE,msg);
  27.    time(&timer); srand(timer); ch = keywait(3);
  28.    for (lcv = 0; lcv < 10 && ch != 27; lcv++) {
  29.        wr = rnd(mxr)+1; wc = rnd(mxc)+1;
  30.        wndmove(wnd,wr,wc);
  31.        ch = keywait(3);
  32.    }
  33.    wpop(wnd); set_cursor_size(tl,bl);
  34. }
  35.  
  36.